package graduationorder.graduationorder.error;

/**
 * @author Mzk
 * @version 1.0
 * @description: 业务异常
 * @date 2024/7/14 下午 5:38
 */
public class BusinessException extends Exception implements CommonError{

    private static final long serialVersionUID = -7097702587120487554L;

    private CommonError commonError;

    public BusinessException(CommonError commonError) {
        super();
        this.commonError = commonError;
    }
    public BusinessException(CommonError commonError, String message) {
        super();
        this.commonError = commonError;
        this.commonError.setErrorMsg(message);
    }

    @Override
    public Integer getErrorCode() {
        return commonError.getErrorCode();
    }

    @Override
    public String getErrorMsg() {
        return commonError.getErrorMsg();
    }

    @Override
    public CommonError setErrorMsg(String errorMsg) {
        return this.commonError.setErrorMsg(errorMsg);
    }
}
